package com.wis.controller;

import com.wis.entity.CourseEntity;
import com.wis.service.UserService;
import com.wis.util.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/user")
public class UserController {
    @Autowired
    private UserService userService;
    /**
     * 首页查询
     * **/
    @GetMapping("/selectAll")
    public CommonResult selectCourseByName(){
        return userService.selectAll();
    }

    /**
     * 搜索
     * **/
    @GetMapping("/selectByName")
    public CommonResult selectByName(@RequestParam(required = false) String name,
                                     @RequestParam(defaultValue = "1") Integer type,
                                     @RequestParam(defaultValue = "1") Integer page,
                                     @RequestParam(defaultValue = "10") Integer limit){
        return userService.selectByName(name,type,page,limit);
    }
}
